package com.hancheng.goodscloud.framework.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.hancheng.commoncloud.framework.config.Knife4jCommonConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.annotation.Resource;

@EnableSwagger2
@EnableKnife4j
@Configuration
public class Knife4jConfig {

    @Resource
    private Knife4jCommonConfig knife4jCommonConfig;

    @Bean
    public Docket goodsWebApi() {
        return knife4jCommonConfig.createDocket(
                "商品信息管理（前端接口）",
                "com.hancheng.goodscloud.business.controller",
                "商品模块提供给前端的接口"
        );
    }

    @Bean
    public Docket goodsInnerApi() {
        return knife4jCommonConfig.createDocket(
                "商品信息管理（内部远程调用接口）",
                "com.hancheng.goodscloud.feign.controller",
                "商品模块提供给其他服务的远程调用接口"
        );
    }
}
